package operation;

import data.Data;
import data.DataBase;


public class SearchChecked implements IOperation {
    @Override
    public void work(DataBase dataBase) {
        System.out.println("查询检测记录！");
        System.out.println("已检测人员：");
        int currentSize=dataBase.getContainSize();
        for (int i = 0; i < currentSize; i++) {
            Data data = dataBase.getData(i);
            if (data.isChecked()) {
                System.out.println(data.getName() + data.getPhone() + "已检测");
            }
        }
        System.out.println("未检测人员：");
        for (int i = 0; i < currentSize; i++) {
            Data data = dataBase.getData(i);
            if (!data.isChecked()) {
                System.out.println(data.getName() + data.getPhone() + "未检测");
            }
        }
    }
}
